using MDL.Class;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace MDL
{
	public class DataReference : Form
	{
		private Dataset dataset;

		private IContainer components = null;

		private ComboBox comboBox3;

		private TextBox textBox4;

		private Label label6;

		private Label label8;

		private TextBox textBox6;

		private Label label9;

		private Button button2;

		private Button button1;

		private TextBox textBox1;

		private Label label1;

		public event TransfDelegate TransfEvent;

		public DataReference(Dataset d, string type)
		{
			dataset = d;
			InitializeComponent();
			textBox6.Text = dataset.Name;
			comboBox3.Text = dataset.Type;
			textBox4.Text = dataset.Description;
			textBox1.Text = dataset.ExternalId;
			if (type == "response(input)")
			{
				label1.Text = "Schema:";
			}
			else
			{
				label1.Text = "ExternalId:";
			}
		}

		private void button1_Click(object sender, EventArgs e)
		{
			dataset.Name = textBox6.Text;
			dataset.Type = comboBox3.Text;
			dataset.Description = textBox4.Text;
			dataset.ExternalId = textBox1.Text;
			this.TransfEvent(dataset);
			Close();
		}

		private void button2_Click(object sender, EventArgs e)
		{
			Close();
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		private void InitializeComponent()
		{
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MDL.DataReference));
			comboBox3 = new System.Windows.Forms.ComboBox();
			textBox4 = new System.Windows.Forms.TextBox();
			label6 = new System.Windows.Forms.Label();
			label8 = new System.Windows.Forms.Label();
			textBox6 = new System.Windows.Forms.TextBox();
			label9 = new System.Windows.Forms.Label();
			button2 = new System.Windows.Forms.Button();
			button1 = new System.Windows.Forms.Button();
			textBox1 = new System.Windows.Forms.TextBox();
			label1 = new System.Windows.Forms.Label();
			SuspendLayout();
			comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			comboBox3.FormattingEnabled = true;
			comboBox3.Items.AddRange(new object[2]
			{
				"internal",
				"external"
			});
			comboBox3.Location = new System.Drawing.Point(74, 84);
			comboBox3.Name = "comboBox3";
			comboBox3.Size = new System.Drawing.Size(261, 20);
			comboBox3.TabIndex = 24;
			textBox4.Location = new System.Drawing.Point(23, 152);
			textBox4.Multiline = true;
			textBox4.Name = "textBox4";
			textBox4.Size = new System.Drawing.Size(312, 76);
			textBox4.TabIndex = 23;
			label6.AutoSize = true;
			label6.Font = new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			label6.Location = new System.Drawing.Point(20, 128);
			label6.Name = "label6";
			label6.Size = new System.Drawing.Size(104, 16);
			label6.TabIndex = 22;
			label6.Text = "Description:";
			label8.AutoSize = true;
			label8.Font = new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			label8.Location = new System.Drawing.Point(20, 84);
			label8.Name = "label8";
			label8.Size = new System.Drawing.Size(48, 16);
			label8.TabIndex = 19;
			label8.Text = "Type:";
			textBox6.Location = new System.Drawing.Point(74, 33);
			textBox6.Name = "textBox6";
			textBox6.Size = new System.Drawing.Size(262, 21);
			textBox6.TabIndex = 18;
			label9.AutoSize = true;
			label9.Font = new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			label9.Location = new System.Drawing.Point(20, 35);
			label9.Name = "label9";
			label9.Size = new System.Drawing.Size(48, 16);
			label9.TabIndex = 17;
			label9.Text = "Name:";
			button2.Font = new System.Drawing.Font("宋体", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			button2.Location = new System.Drawing.Point(218, 379);
			button2.Name = "button2";
			button2.Size = new System.Drawing.Size(75, 23);
			button2.TabIndex = 26;
			button2.Text = "Cancel";
			button2.UseVisualStyleBackColor = true;
			button2.Click += new System.EventHandler(button2_Click);
			button1.Font = new System.Drawing.Font("宋体", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			button1.Location = new System.Drawing.Point(58, 379);
			button1.Name = "button1";
			button1.Size = new System.Drawing.Size(75, 23);
			button1.TabIndex = 25;
			button1.Text = "Save";
			button1.UseVisualStyleBackColor = true;
			button1.Click += new System.EventHandler(button1_Click);
			textBox1.Location = new System.Drawing.Point(23, 274);
			textBox1.Multiline = true;
			textBox1.Name = "textBox1";
			textBox1.Size = new System.Drawing.Size(312, 75);
			textBox1.TabIndex = 28;
			label1.AutoSize = true;
			label1.Font = new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			label1.Location = new System.Drawing.Point(20, 250);
			label1.Name = "label1";
			label1.Size = new System.Drawing.Size(96, 16);
			label1.TabIndex = 27;
			label1.Text = "ExternalId:";
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			BackColor = System.Drawing.SystemColors.GradientActiveCaption;
			base.ClientSize = new System.Drawing.Size(358, 422);
			base.Controls.Add(textBox1);
			base.Controls.Add(label1);
			base.Controls.Add(button2);
			base.Controls.Add(button1);
			base.Controls.Add(comboBox3);
			base.Controls.Add(textBox4);
			base.Controls.Add(label6);
			base.Controls.Add(label8);
			base.Controls.Add(textBox6);
			base.Controls.Add(label9);
			base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
			base.Name = "DataReference";
			Text = "Data Reference";
			ResumeLayout(false);
			PerformLayout();
		}
	}
}
